<template>
  <div class="container">
    <router-view></router-view>
    <van-tabbar
      v-model="active"
      @change="tabChange"
      route
      active-color="#4775d9"
    >
      <van-tabbar-item replace to="/readList" icon="apps-o"
        >首页</van-tabbar-item
      >
      <van-tabbar-item replace to="/consultation" icon="description"
        >我的咨询</van-tabbar-item
      >
      <van-tabbar-item replace to="/mine" icon="contact"
        >个人中心</van-tabbar-item
      >
    </van-tabbar>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import { getStorage } from "@/utils/auth";
export default {
  name: "index",
  components: {},
  data() {
    return {
      active: 0,
    };
  },
  computed: {
    ...mapGetters(["userData"]),
  },
  watch: {},
  methods: {
    tabChange(i) {
      this.$store.commit("list/SET_BACK_STATUS", null);
    },
  },
  created() {
    // console.log(JSON.parse(this.userData),11)
    let lang = getStorage("lang");
    this.$i18n.locale = lang ? lang : "cn";
  },
  mounted() {},
  destroyed() {},
};
</script>
<style lang='scss' scoped>
</style>